<?php

/* @var $this \yii\web\View */
/* @var $content string */

use yii\helpers\Html;
use app\assets\AppAsset;
use app\modules\admin\models\CwTpl;

$tpl = CwTpl::find()->all();

AppAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>">
<head>
    <meta charset="<?= Yii::$app->charset ?>">
    <?= Html::csrfMetaTags() ?>
    <title><?= Yii::$app->params['app_name']?></title>
    <?php $this->head() ?>
</head>
<body>
<?php $this->beginBody() ?>

    <div class="navbar">
        <ul class="nav nav-tabs">
            <li id="default" role="presentation"><a href="<?= \yii\helpers\Url::to(["default/index"])?>">首页</a></li>
            <li id="cw-nav" role="presentation"><a href="<?= \yii\helpers\Url::to(["cw-nav/index"])?>">导航</a></li>
            <li id="cw-article" role="presentation"><a href="<?= \yii\helpers\Url::to(["cw-article/index"])?>">文章</a></li>
            <li id="cw-carousel" role="presentation"><a href="<?= \yii\helpers\Url::to(["cw-carousel/index"])?>">轮播图</a></li>
            <li id="cw-panel" role="presentation"><a href="<?= \yii\helpers\Url::to(["cw-panel/index"])?>">小面板</a></li>
            <li id="cw-tpl" class="dropdown" role="presentation"><a class="dropdown-toggle" href="#" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">模板<span class="caret"></span></a>
                <ul class="dropdown-menu" aria-labelledby="cw-tpl">
                    <?php foreach ($tpl as $value):?>
                    <li><a href="<?= yii\helpers\Url::to(["cw-tpl".$value->tpl_id."-article/index"])?>"><?=$value->tpl_name?></a></li>
                    <?php endforeach;?>
                </ul>
            </li>
            <li id="cw-admin" role="presentation" class="dropdown pull-right"><a id="admin" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" data-toggle="dropdown" href="#">Admin</a>
                <ul class="dropdown-menu" aria-labelledby="admin">
                    <li><a href="<?= \yii\helpers\Url::to(["cw-admin/update","id"=> Yii::$app->session['admin']['ID']])?>">修改密码</a></li>
                    <li><a href="<?= \yii\helpers\Url::to(["default/logout"])?>">注销</a></li>
                </ul>
            </li>
        </ul>
    </div>
    
<div class="wrap" style="min-height: 90%">
    <div class="container" style="padding: 0">
        <?= $content ?>
    </div>
</div>

<footer class="footer">
    <div class="container">
        <p class="pull-left">&copy; <?= Yii::$app->params['app_company']?><?= date('Y') ?></p>

        <p class="pull-right">Powered by Lione <a href="#" data-toggle="modal" data-target="#myModal">CatWalk</a></p>
    </div>
</footer>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><?= Yii::$app->params['cms_version']?></h4>
      </div>
        <div class="modal-body" style="height: 500px; background-image: url(./img/CatWalk.png); background-size: cover">
        
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>
<?php $this->endBody() ?>
</body>

</html>
<?php $this->endPage() ?>
